#ifndef MODULE_H_
#define MODULE_H_
#include <config.h>
#include <string.h>
#include <stdlib.h>
#include <stdint.h>
#include <err.h>
#include <sys/time.h>
#include <sys/param.h>
#include <sys/sysctl.h>
#include <sys/user.h>
#include <sys/socket.h>
#ifdef __FreeBSD__
#include <net/if.h>
#include <net/if_var.h>
#include <net/if_types.h>
#include <net/if_mib.h>
#endif

//#ifdef _HAVE_IFADDRS_H
#include <ifaddrs.h>
//#endif

#include <sys/types.h>
#include <sys/socket.h>


#define SHOW_IFACE_LOAD_PERCENT 0
#define SHOW_IFACE_LOAD_BYTES 1
#define SHOW_IFACE_IN 2
#define SHOW_IFACE_OUT 3
#define SHOW_IFACE_IN_OUT 4
#define SHOW_IFACE_NAME 5


/**
 * \typedef
 * This structure is used to store module specific variables
 */
typedef struct _Core Core;
/**
 * \typedef
 * This structure is used to store Core Config
 */
typedef struct _Core_Config Core_Config;
/**
 * \typedef
 * This structure is used to store Core PopUp Notification variables 
 */
typedef struct _Core_Popup Core_Popup;

/**
 * \typedef
 * This structure is used to store widget specific variables
 */
typedef struct _Widget Widget;
/**
 * \typedef
 * This structure is used to store widget configuration
 */
typedef struct _Widget_Config Widget_Config;
/**
 * \typedef
 * This structure is used to store widget popup variables
 */
typedef struct _Widget_Popup Widget_Popup;

#ifdef __FreeBSD__
struct iface_stats
{
	u_char link_state;
	u_long baudrate;
	u_long ipackets;
	u_long opackets;
	u_long ibytes;
	u_long obytes;
};
#endif
#ifdef __linux__
typedef struct iface_stats If_Stats;
struct iface_stats
{
	char if_name[64];
	u_char link_state;
	u_long baudrate;
	u_long ipackets;
	u_long opackets;
	u_long ibytes;
	u_long obytes;
};
#endif

static struct _Core{
	E_Module *m;
	Core_Config *conf;
//	int 	 widgets_count;
   	Evas_List *widgets;
   	E_Config_Dialog *config_dialog;
   	Ecore_Timer *timer;
};

static struct _Core_Config{
	int version;
	int poll_time;
	int notification;
	Evas_List *items;
	/*- Default Widget Config -*/
	const char *theme;
	int alpha;
};

static struct _Core_Popup{

};


static struct _Widget{
	E_Module *m;
	Widget_Config *conf;
	E_Gadcon_Client *gcc;
  	Evas_Object *canvas;
  	E_Menu *menu;
	E_Config_Dialog *config_dialog;
	u_char link_state;
	u_long baudrate;
	u_long ipackets;
	u_long opackets;
	u_long ibytes;
	u_long obytes;
};
static struct _Widget_Config{
/**
 * Widget Config ID
 */
	const char *id;
/**
 * Widget theme filename
 */
	const char *theme;
/**
 * Widget transparancy
 */
	int alpha;
/**
 * Widget monitored iface
 */	
	const char *iface;
/**
 * Popup window with stats on click
 */	
	int have_popup;
};
/*
	for this we wouldn`t have any config data
*/
static struct _Widget_Popup{

};




#endif /*MODULE_H_*/
